using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace MusicEvolution.Database
{
	public class Device : DataBaseRow
	{
		DataField _HardwareID;
		DataField _Name;
		DataField _LastSeen;
		DataField _LastSync;

        public Device()
        {
            _HardwareID = new DataField("HardwareID", "");
            _Name = new DataField("Name", "");
            _LastSeen = new DataField("LastSeen", "");
            _LastSync = new DataField("LastSync", "");

            base.Add(_HardwareID);
            base.Add(_Name);
            base.Add(_LastSeen);
            base.Add(_LastSync);

        }

		public string HardwareID
		{
			get
			{
                return _HardwareID.Value;
			}
			set
			{
                _HardwareID.Value = value;
			}
		}

		public string Name
		{
			get
			{
                return _Name.Value;
			}
			set
			{
                _Name.Value = value;
			}
		}

		public DateTime LastSeen
		{
			get
			{
                return DateTime.FromFileTime(Convert.ToInt64(_LastSeen.Value));
			}
			set
			{
                _LastSeen.Value = value.ToFileTime().ToString();
			}
		}

		public DateTime LastSync
		{
			get
			{
                return DateTime.FromFileTime(Convert.ToInt64(_LastSync.Value));
			}
			set
			{
                _LastSync.Value = value.ToFileTime().ToString();
			}
		}
	}
}
